package com.funmi.lizip.service.impl;

import com.funmi.lizip.entity.Camera;
import com.funmi.lizip.mapper.CameraMapper;
import com.funmi.lizip.service.CameraService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author yeyg
 * @since 2022-11-02
 */
@Service
public class CameraServiceImpl extends ServiceImpl<CameraMapper, Camera> implements CameraService {

    @Autowired
    private CameraMapper cameraMapper;

    /**
     * 根据相机类型，和关键字搜索
     * @param cameraType
     * @param keyWords
     * @return
     */
    @Override
    public List<Camera> getInfraredCameras(String cameraType, String keyWords) {
        if (StringUtils.isEmpty(cameraType)){

        }
        if (StringUtils.isEmpty(keyWords)){

        }
        return null;
    }

    /**
     * 获取所有红外相机
     * @return
     */
    @Override
    public List<Camera> getAll() {
        return cameraMapper.getAll();
    }

    /**
     * 获取位置信息:区域，经纬度，海拔
     * @return
     */
    @Override
    public List<Camera> getPositions() {
        return cameraMapper.getPositions();
    }

    /**
     * 根据id获取
     * @param id
     * @return
     */
    @Override
    public Camera getById(int id) {
        return cameraMapper.getById(id);
    }
}
